package com.dbappsecurity.network.api.services;

import io.reactivex.Single;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.*;

import java.util.Map;

/**
 * Created by Arirus on 2018/4/2.
 */

public interface ApiService {
    @GET
    Single<String> get(@Url String url);

    @GET
    Single<String> get(@Url String url, @QueryMap(encoded = true) Map<String, Object> map);

    @FormUrlEncoded
    @POST
    Single<String> post(@Url String url, @FieldMap(encoded = true) Map<String, Object> map);

    @Multipart
    @POST
    Single<String> postPartMap(@Url String url, @PartMap Map<String, RequestBody> map);

    @Multipart
    @POST
    Single<String> postPart(@Url String url, @Part MultipartBody.Part file);

    @POST
    Single<String> post(@Url String url, @Body RequestBody body);

    @PUT
    Single<String> put(@Url String url, @Body RequestBody body);
}
